package com.qianfeng.smartmeeting.controller.user;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.qianfeng.smartmeeting.util.PageUtils;
import com.qianfeng.smartmeeting.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.qianfeng.smartmeeting.entity.UserroomEntity;
import com.qianfeng.smartmeeting.service.UserroomService;



/**
 * 
 *
 * @author baixiaofei
 * @email 2053989588@qq.com
 * @date 2025-07-02 15:06:43
 */
@RestController
@RequestMapping("smartmeeting/user/userroom")
public class UserroomController {
    @Autowired
    private UserroomService userroomService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("smartmeeting:userroom:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = userroomService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("smartmeeting:userroom:info")
    public R info(@PathVariable("id") Integer id){
		UserroomEntity userroom = userroomService.getById(id);

        return R.ok().put("userroom", userroom);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("smartmeeting:userroom:save")
    public R save(@RequestBody UserroomEntity userroom){
		userroomService.save(userroom);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("smartmeeting:userroom:update")
    public R update(@RequestBody UserroomEntity userroom){
		userroomService.updateById(userroom);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("smartmeeting:userroom:delete")
    public R delete(@RequestBody Integer[] ids){
		userroomService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
